import cv2
import numpy as np
imagePoints=np.array([(1000, 802), (1435, 675), (896, 436), (1237, 222)]).astype('float32')
objectPoints=np.array([[0,0,0],[0,800,0],[800,0,0],[800,800,0]]).astype('float32')
cameraMatrix=np.array( [[894.348826   ,  0,         936.44500723],
 [  0,         896.42857334, 558.08348431],
 [  0,           0,           1,        ]])
distCoeffs=np.array([0,0,0,0,0]).astype('float32')
retval,rvet,tvet=cv2.solvePnP(objectPoints,imagePoints,cameraMatrix,distCoeffs)
print('rvet',rvet)
print('tvet',tvet)
re,jac=cv2.projectPoints(objectPoints,rvet,tvet,cameraMatrix,distCoeffs)
print('re',re)